import requests
import json

# window.en = a.a.prototype.$JSEncrypt
# window.en({
#     "BadmintonId": "1",
#     "BadmintonRoom": "东丽场地-1",
#     "date": "2023-03-02",
#     "time": [
#         "12:00 - 13:00"
#     ],
#     "count": 2,
# })


# Fa.ungzip(Ha("1f8b08000000000000030dcbc90dc0300804c096c0b0019ee6eabfa4f83bd29012b45ab19c1722903bd2c538c7fc933173f51e06ec26fb46d7ae6f0eec6876959f9bc1c3f5a588f21bdd051a5f6bd3898e7eb43ade09dd20b27b50994bf358e207eb08de8382000000"), {
#                 to: "string"
#             })
# '04054CD45F1BA53353AE3DC15227863E77848DE1557AB18F9DCFF8FBE5724BDCC82AB91E1C6B33413E7DDC50E8F7D74E9D9DE7DF4E8DB54F9007A25CBBF0EDF439'
# '04054CD45F1BA53353AE3DC15227863E77848DE1557AB18F9DCFF8FBE5724BDCC82AB91E1C6B33413E7DDC50E8F7D74E9D9DE7DF4E8DB54F9007A25CBBF0EDF439'
# '04054CD45F1BA53353AE3DC15227863E77848DE1557AB18F9DCFF8FBE5724BDCC82AB91E1C6B33413E7DDC50E8F7D74E9D9DE7DF4E8DB54F9007A25CBBF0EDF439'

headers = {
    "Accept": "application/json, text/plain, */*",
    "Accept-Language": "zh-CN,zh;q=0.9",
    "Connection": "keep-alive",
    "Content-Type": "application/json",
    "Origin": "https://shfwyy.cauc.edu.cn",
    "Referer": "https://shfwyy.cauc.edu.cn/Badminton",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-origin",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36",
    "sec-ch-ua": "\"Chromium\";v=\"110\", \"Not A(Brand\";v=\"24\", \"Google Chrome\";v=\"110\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\""
}
url = "https://shfwyy.cauc.edu.cn/badminton/save.do"
params = {
    "token": "6a365fc1253535aa34c812312379189999"
}
data = {
    "BadmintonId": "1",
    "BadmintonRoom": "东丽场地-1",
    "date": "2023-03-02",
    "time": [
        ""
    ],
    "count": 2,
    "data": "04b31e945c909371bf6f20abce5df33749deacbc1a1dd5ed6cb778fa80578bad698e007941a1cff9dfa0a5f672f5af385e1d078064e02e75ee3432442d1a56df9156161f7034a9b09d75de3d60c7f8a59d90854cdc34651b9036912e53ed5da5e0815aff4b2205697fcdce90cabf88faa276e58cc3a966b2bda5a1053b4517b1e4cd747c6de42c46a36f1de7a7af3be470a7968dd19e33f2fdfd8e4df6ce76fe5eee0ddc0e50514c6b77eb9a2a08745b425f9d613f1176fe32dc5e364f9bff"
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, params=params, data=data)

print(response.text)
print(response)